import 'package:lib_base/data_repository/data_repository.dart';
import 'package:lib_service/models/device_model.dart';

class DeviceModelRepository extends DataRepository<DeviceModel> {
  static const String kId = "DeviceModelRepository";

  @override
  String get id => DeviceModelRepository.kId;

  @override
  dynamic encode(DeviceModel data) {
    return data.toJson();
  }

  @override
  DeviceModel? decode(dynamic data) {
    return data != null
        ? DeviceModel.fromJson(Map<String, dynamic>.from(data))
        : null;
  }
}
